//
//  TabBar.h
//  LotteryClient
//
//  Created by Suny on 14-7-5.
//  Copyright (c) 2014年 CTTC. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "TabBarItem.h"
@protocol TabBarDelegate;

@interface TabBar : UIView
{
    UIImage               *_backgroundImage;
    UIImage               *_selectionIndicatorImage;
    UIImage               *_shadowImage;
    
    NSArray               *_items;
    TabBarItem *_selectedItem;
    
    BOOL                   _animateSelection;
    
    id<TabBarDelegate> __weak _delegate;
}

@property (nonatomic, weak) id<TabBarDelegate> delegate;
@property (nonatomic, strong) NSArray             *items;
@property (nonatomic, strong) TabBarItem *selectedItem;
@property (nonatomic, strong) UIImage             *backgroundImage;
@property (nonatomic, strong) UIImage             *selectionIndicatorImage;
@property (nonatomic, strong) UIImage             *shadowImage;
@property (nonatomic, assign) BOOL                 animateSelection;
@property (nonatomic, assign) NSUInteger           selectedIndex;

@property(nonatomic) BOOL showBigItemCenter;

- (void)setItems:(NSArray *)items animated:(BOOL)animated;

@end

@protocol TabBarDelegate <NSObject>

@optional
 
- (BOOL)tabBar:(TabBar *)tabBar willSelectItemAtIndex:(NSUInteger)index tabBarItem:(TabBarItem *)item;

- (void)tabBar:(TabBar *)tabBar didSelectItemAtIndex:(NSUInteger)index tabBarItem:(TabBarItem *)item;

@end
